package com.ijmacd.footballtracker;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class FTBroadcastReceiver extends BroadcastReceiver {

	private static final String TAG = "FTBroadcastReceiver";

	@Override
	public void onReceive(Context context, Intent intent) {
		Log.d(TAG, "I'm alive!");
		if(intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)){
			Log.d(TAG, "Starting Service on boot");
			ComponentName service = context.startService(new Intent(context, DataFetcher.class));
			if(service == null){
				Log.e(TAG, "Service not started");
			}
		}
	}

}
